package cn.tedu.account.controller;

import cn.tedu.account.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * @ClassName AccountController
 * @Description:类描述
 * @Author Tedu
 * @Date 2021/7/1 10:31
 * @Version V1.0
 **/
@RestController
public class AccountController {
    @Autowired
    private AccountService accountService;
    @GetMapping("/decrease/{userId}/{money}")
    public String decrease(
            @PathVariable("userId")Long userId, @PathVariable("money")BigDecimal money){
        accountService.decrease(userId, money);
        return "修改账户余额成功!";
    }
}
